#include <stdio.h>
#include <stdlib.h>

#define MAX_SIZE 11
int main(){
    int sqList[MAX_SIZE] = {4, 3, 4, 1, 4, 2, 4, 9, 4, 7, 4};
    int count = 1;
    int goal = sqList[0];
    for(int i = 1; i < MAX_SIZE; i++){
        if(sqList[i] == goal){
            count++;
        }else{
            if(count > 0){
		count--;
            }else{
            	goal = sqList[i];
            	count = 1;
	    }
        }
    }
    printf("%d\n", goal);
    return 0;
}
